// constructor值只读吗?

// 看一下symbol=>基本数据类型  不能new实例化
// console.log(new Symbol(123)); 
// Uncaught TypeError: Symbol is not a constructor
var sym = Symbol(123)
console.log(sym); //Symbol(123)
console.log(sym.constructor); //Symbol
// 这个constructor属性其实是指向了Symbol的原型上属性,即Symbol.prototype.constructor 返回创建实例原型的函数， 默认为 Symbol 函数

// 对于引用类型来说constructor属性值可以修改,但是对于基本数据类型来说不能修改
function Student (obj){
    this.name = obj.name;
    this.age = obj.age
    this.sex = obj.sex
    console.log(this.name+',年龄:'+this.age+',性别:'+this.sex);
}
Student.prototype.learnFun = function () {
    console.log('上课50分钟,休息10分钟');
}
var stuObj1 = {name:'wang',age:12,sex:'男'}
var stu1 = new Student (stuObj1)
stu1.learnFun()

var stuObj2 = {name:'丽丽',age:15,sex:'女'}
var stu2 = new Student (stuObj2)

var stuObj3 = {name:'mingming',age:16,sex:'男'}

function Stu3(){}
Stu3.prototype = new Student(stuObj3)
Stu3.prototype.student = '好学生'

console.log(Stu3.constructor); //Function() { [native code] }
console.log(Stu3.prototype.constructor===Student); 

var test = new Stu3 ()
console.log(test);
